
package com.csc440.team2.smil;

import java.io.Serializable;


import com.csc440.team2.SmilConstants;


/**
 * Generic SMIL Component class
 * 
 * @author Brad Gardner, Alex Povkov
 */
public abstract class SMILComponent implements Serializable
{
    private static final long serialVersionUID = 1L;

    private int type;
    private int begin;
    private int duration;
    private String regionId;


    /**
     * @return the type
     */
    public int getType()
    {
        return type;
    }


    /**
     * @param type the type to set
     */
    protected void setType(int type)
    {
        this.type = type;
    }


    /**
     * @return the begin
     */
    public int getBegin()
    {
        return begin;
    }


    /**
     * @param begin the begin to set
     */
    public void setBegin(int begin)
    {
        this.begin = begin;
    }


    /**
     * @return the duration
     */
    public int getDuration()
    {
        return duration;
    }


    /**
     * @param duration the duration to set
     */
    public void setDuration(int duration)
    {
        this.duration = duration;
    }


    /**
     * @return the regionId
     */
    public String getRegionId()
    {
        return regionId;
    }


    /**
     * @param regionId the regionId to set
     */
    public void setRegionId(String regionId)
    {
        this.regionId = regionId;
    }


    @Override
    public String toString()
    {
        switch (type)
        {
            case SmilConstants.COMPONENT_TYPE_TEXT:
                return "Text Component";
            default:
                return "Component";
        }
    }
}
